<?php
/**
 * Created by PhpStorm.
 * User: junyv
 * Date: 2017/4/6
 * Time: 8:57
 */

namespace app\manage\controller;


class Baoming extends Base
{
    protected $beforeActionList = [
        'beforeIndex'  =>  ['only'=>'index'],
    ];
    public function beforeIndex(){
        $this->_ajaxedit = true;
       //$model = input('get.model','house');
       //$this->_name = $model;
    }

    public function _search(){
        $model = input('get.model','house');
        $type  = input('get.type/d',0);
        $where['model'] = $model;
        $type && $where['type']  = $type;
        ($keyword = input('get.keyword')) && $where['house_title'] = ['like','%'.$keyword.'%'];
        $status = -1;
        if(isset($_GET['status']) && $_GET['status'] !== ''){
            $status = input('get.status/d');
        }
        $status>=0 && $where['status'] = ['eq',$status];
        $this->assign('search',[
            'model' => $model,
            'type'  => $type,
            'status' => $status,
            'keyword' => $keyword
        ]);
        return $where;
    }
}